Skip to content

feat: add support for SharedArrayBuffer in TypedArray and TypedArrayOf#1731

Merged
legendecas merged 1 commit into
nodejs:mainfrom
KevinEady:support-sharedarraybuffer-in-typedarray
May 24, 2026
Merged

feat: add support for SharedArrayBuffer in TypedArray and TypedArrayOf#1731
legendecas merged 1 commit into
nodejs:mainfrom
KevinEady:support-sharedarraybuffer-in-typedarray

Conversation

@KevinEady
Copy link
Copy Markdown
Contributor

@KevinEady KevinEady commented May 21, 2026

Add support for SharedArrayBuffer in TypedArray and TypedArrayOf<T>.

Fixes: #1730

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.69%. Comparing base (f65113b) to head (b247aa8).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
napi-inl.h 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1731      +/-   ##
==========================================
+ Coverage   63.65%   63.69%   +0.03%     
==========================================
  Files           3        3              
  Lines        2058     2063       +5     
  Branches      729      730       +1     
==========================================
+ Hits         1310     1314       +4     
  Misses        162      162              
- Partials      586      587       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KevinEady KevinEady force-pushed the support-sharedarraybuffer-in-typedarray branch from 3de1889 to 09557a9 Compare May 22, 2026 08:32
Comment thread test/typedarray.js
assert.ok(bAsValue instanceof SharedArrayBuffer);
assert.strictEqual(bAsValue, sab);
} catch (ex) {
if (ex.message === 'Invalid argument') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this error is only expected on binding.typedarray.createInt8TypedArrayFromSharedArrayBuffer. Could this try...catch scope be limited to this single call instead?

@legendecas legendecas moved this from Need Triage to In Progress in Node-API Team Project May 22, 2026
@KevinEady KevinEady force-pushed the support-sharedarraybuffer-in-typedarray branch from 09557a9 to b247aa8 Compare May 22, 2026 17:31
@legendecas legendecas merged commit 00b95ef into nodejs:main May 24, 2026
105 of 108 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Node-API Team Project May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Add SharedArrayBuffer support in Napi::TypedArray

3 participants